package MemberAction;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import DAO.MemberDAO;
import DTO.ZipcodeBean;

public class MemberZipcodeAction2 implements MemAction {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		MemberDAO dao = new MemberDAO();
		RequestDispatcher dis = null;
		try {
			request.setCharacterEncoding("euc-kr");
			String dong = request.getParameter("dong");
			ArrayList<ZipcodeBean> ziplist = dao.zipSearch(dong);
			//System.out.println(ziplist.size());
			request.setAttribute("ziplist", ziplist);
			dis = request.getRequestDispatcher("./member/member_zipcode.jsp");
			dis.forward(request, response);

		} catch (IOException | ServletException e) {
			e.printStackTrace();
		}

	}// exe
}// class
